﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XXS.Common.BaseModel
{
    public class TreeBaseModel : BaseModel, ITreeBaseModel
    {
        public string Text { get; set; }
        public string IdPath { get; set; }
        public string TextPath { get; set; }
        public Guid? ParentId { get; set; }

        /// <summary>
        ///     排序
        /// </summary>
        public int Order { get; set; }

        public List<Guid> GetIdPaths()
        {
            return IdPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Select(Guid.Parse).ToList();
        }

        public List<string> GetTextPaths()
        {
            return TextPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).ToList();
        }
    }
}
